//
//  supplierTableViewCell.m
//  YiFei
//
//  Created by yangyan on 16/8/31.
//  Copyright © 2016年 yous. All rights reserved.
//

#import "supplierTableViewCell.h"

@implementation supplierTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addView];
    }
    return self;
}

-(void)addView{
    _viewback=[[UIView alloc] init];
    [_viewback sizeToFit];
    _viewback.backgroundColor=[UIColor whiteColor];
    _viewback.layer.masksToBounds=YES;
    _viewback.layer.cornerRadius=5.0;

    _viewback.frame=CGRectMake(10, 0, WIDTH-20, 9*30);
    [self.contentView addSubview:_viewback];

    NSArray *titleA=@[@"名称",@"现价",@"日期"];
    for (int i=0; i<titleA.count; i++) {
        UILabel *labelL=[[UILabel alloc] init];
        [labelL sizeToFit];
        labelL.text=titleA[i];
        labelL.textColor=[UIColor lightGrayColor];
        labelL.font=[UIFont systemFontOfSize:14.0];
        labelL.frame=CGRectMake(5+40*i+(WIDTH-150)/3*i, 5, 40, 30);
        [_viewback addSubview:labelL];
        
        _nameL=[[UILabel alloc] init];
        [_nameL sizeToFit];
        _nameL.font=[UIFont systemFontOfSize:14.0];
        _nameL.text=@"aaa";
        _nameL.frame=CGRectMake(CGRectGetMaxX(labelL.frame), 5, 100, 30);
        [_viewback addSubview:_nameL];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
